package File;

import java.io.File;
import java.io.FileFilter;

public class listFileDemo4 {
    public static void main(String[] args) {
        File dir = new File(".");
        if (dir.isDirectory()) {
            FileFilter fileFilter = file -> file.getName().contains("o");
            File[] subs = dir.listFiles(fileFilter);
            for (int i = 0; i < subs.length; i++) {
                System.out.println(subs[i].getName());
            }
        }
    }

}
